package com.halflife.comeElectricity.orderMng.order.dto;

/**
 * Created by zhaoyf on 2018/2/13.
 */
public class SiteDTO implements Comparable<SiteDTO> {
    public String userAddress;
    public String userAddressDetail;
    public String userName ;
    public String userContact;
    public String locationLan;
    public String locationLat;
    public Integer isFarest;
    public Double distance;

    public Double getDistance() {
        if(distance==null){
            distance = 0d;
        }
        return distance;
    }

    public void setDistance(Double distance) {
        this.distance = distance;
    }

    public String getUserAddress() {
        return userAddress;
    }

    public void setUserAddress(String userAddress) {
        this.userAddress = userAddress;
    }

    public String getUserAddressDetail() {
        return userAddressDetail;
    }

    public void setUserAddressDetail(String userAddressDetail) {
        this.userAddressDetail = userAddressDetail;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserContact() {
        return userContact;
    }

    public void setUserContact(String userContact) {
        this.userContact = userContact;
    }

    public String getLocationLan() {
        return locationLan;
    }

    public void setLocationLan(String locationLan) {
        this.locationLan = locationLan;
    }

    public String getLocationLat() {
        return locationLat;
    }

    public void setLocationLat(String locationLat) {
        this.locationLat = locationLat;
    }

    public Integer getIsFarest() {
        return isFarest;
    }

    public void setIsFarest(Integer isFarest) {
        this.isFarest = isFarest;
    }

    @Override
    public int compareTo(SiteDTO o) {
        if(this.getDistance()>o.getDistance()){
            return 1;
        }else if(this.getDistance()<o.getDistance()){
            return -1;
        }
        return 0;
    }
}
